<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8" />
	<title>动态显示系统时间</title>
	<style type="text/css">
		body {
			width: 913px;
			margin: 0px auto;
		}

		.main {
			font-family: "黑体";
			font-size: 25px;
			color: #CC0000;
		}

		.clock {
			font-size: 50px;
			color: #CC0000;
			border-style: none
		}
	</style>
	
</head>
<body onload="showTime()">
	<div class="top">
		<img src="images/banner.png" alt="banner" />
	</div>
	<div class="main">
		当前系统时间：<input class="clock" type="text" id="time" />
	</div>
	<script type="text/javascript">
		function showTime(){
			    var myDate=new Date();
				var hour=myDate.getHours();
                var minutes=myDate.getMinutes();
                var seconds=myDate.getSeconds();
                if(hour<10)
                    hour="0"+hour;
                if(minutes<10)
                    minutes="0"+minutes;
                if(seconds<10)
                    seconds="0"+seconds;
                document.getElementById("time").innerHTML="当前时间："+ hour +":"+minutes+":"+seconds;
				setTimeout("showTime()",1000); 
			}
			window.onload=showTime;

	</script>
</body>

</html>